import styles from './index.module.scss';
import { useTranslation } from 'react-i18next';

export default (props) => {
    const { noticeList } = props
    const { t } = useTranslation();
    return (
        <div className={styles.container}>
            {noticeList.length > 0 ? (
                noticeList.map((item, idx) => (
                    <div key={idx} className={styles.noticeItem}>
                        <div className={styles.title}>{item.title}</div>
                        <div className={styles.content}>{item.content}</div>
                        <div className={styles.time}>{item.createTime}</div>
                    </div>
                ))
            ) : (
                <div className={styles.emptyNotice}>
                    {t('common.notNotive.unread')}
                </div>
            )}
        </div>
    );
}